//
//  YMHomeSectionHeadView.m
//  YMMedical
//
//  Created by y s on 2023/7/19.
//

#import "YMHomeSectionHeadView.h"

@interface YMHomeSectionHeadView ()

@property (nonatomic, strong) UIView *vLine;
@property (nonatomic, strong) UILabel *lblTitle;

@end

@implementation YMHomeSectionHeadView

- (instancetype)init{
    self = [super init];
    if (self) {
        [self setUI];
    }
    return self;
}

#pragma mark -- UI
- (void)setUI{
    [self addSubview:self.vLine];
    [self addSubview:self.lblTitle];
    
    [self.vLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo([SFitUtil fit:10]);
        make.centerY.mas_equalTo(0);
        make.size.mas_equalTo([SFitUtil fitSize:4 height:16]);
    }];
    [self.lblTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.vLine.mas_right).offset([SFitUtil fit:6]);
        make.centerY.mas_equalTo(0);
        make.right.mas_equalTo([SFitUtil fit:-15]);
    }];
}

- (void)setStrTitle:(NSString *)strTitle{
    self.lblTitle.text = strTitle;
}

#pragma mark -- setter and getter
- (UIView *)vLine{
    if (_vLine == nil){
        _vLine = [[UIView alloc] init];
        _vLine.backgroundColor = STheme.D12;
        _vLine.layer.cornerRadius = [SFitUtil fit:2];
        _vLine.clipsToBounds = YES;
    }
    return _vLine;
}
- (UILabel *)lblTitle{
    if (_lblTitle == nil){
        _lblTitle = [[UILabel alloc] init];
        _lblTitle.textColor = STheme.D1;
        _lblTitle.font = [SFitUtil fitBoldFont:16];
    }
    return _lblTitle;
}

@end
